﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="remindarea.aspx.cs" Inherits="Ccit.SysPlat.Frame.remindarea" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="Stylesheet" href="css/main.css" type="text/css" />
    <link rel="Stylesheet" href="css/mof.css" type="text/css" />
    <script type="text/javascript" src="script/jquery.js"></script>       
    <script type="text/javascript" src="script/interface.js"></script>
    <script type="text/javascript" src="script/jcontrol.js"></script> 
    <script type="text/javascript" src="script/jwindow.js"></script> 
    <script type="text/javascript" src="script/StringClass_Ext.js"></script> 
    
    <style type='text/css'>  
        .weather { FONT-WEIGHT: bold; FONT-SIZE: 10pt; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; FONT-FAMILY: 黑体 }
        .weather1 { FONT-SIZE: 10pt; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; FONT-FAMILY: 新宋体 }
        a {
	        color: #333333;	
	        text-decoration: none;
	        font-size: 12px;
        }
        a:hover {
	        color: #FF3300;	        
	        text-decoration: none;
	        font-size: 12px;
        }
        .ctl{ table-layout:fixed }
        .ctl td{ text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:2px}
    </style>    
    <style type="text/css" media="all">      
    .groupWrapper
    {   
	    float: left;	    	    
    }
    .serializer
    {
	    clear: both;
    }
    .groupItem
    {
	    margin-bottom: 0px;
    }
    .groupItem .itemHeader
    {   
	    cursor: move;
	    position: relative;
    }

    .groupItem .itemHeader a
    {
	        
	    text-decoration: none;
    }
    .sortHelper
    {
	    border: 3px dashed #666;
	    width: auto !important;
    }
    .groupWrapper p
    {
	    height: 1px;
	    overflow: hidden;
	    margin: 0;
	    padding: 0;
    }
    </style>
    <style type='text/css'>img{border:0;}#index_page{float:right;display:block;height:16px;padding:2px 0;margin-right:4px;}#index_page *{float:left;display:inline;line-height:16px;border:1px solid #B6CFCD;text-align:center;padding:0;margin:0 2px;}#index_page strong{background:#009A91;color:#fff;width:16px;}#index_page a{width:16px;color:#009A91;text-decoration:none;}</style>
    
    <script type="text/javascript">
    <!--
        function doOpenLink(linkAddress,popMode) {
            if(popMode == "1") {
                document.location.href = linkAddress;
            }
            else
                OpenWindow(linkAddress,"","","");
        }
        
        function doLinkMore(serMoreInfo,popMode) {
            //eval("var moreInfoArr=" + serMoreInfo);
            document.location.href = serMoreInfo[0];
//            var itemCount = serMoreInfo.length;
//            if(itemCount == 4) {
//               parent.doAutoCutMenu(serMoreInfo);
//            }
//            
//            moreInfoArr = null;
        }
        
        function doExpandWindow(plateId) {
            var ctrlSign = $get("_hid_win_ctrl_" + plateId);
            var ctrlTr = $get("tr_window_plate_" + plateId);            
            
            if(null == ctrlSign || ctrlSign == "undefined" || ctrlSign.value == "0") {
                // 未展开状态
                ctrlTr.style.display = "block";
                ctrlSign.value = "1";
            }
            else if(ctrlSign.value == "1") {                
                ctrlTr.style.display = "none";
                ctrlSign.value = "0";
            }
            else{}
        
        }
        
        function doShowWinSet(plateId,plateType) {
            var ctrlSign = $get("_hid_win_attrset_" + plateId);
            var vesCtrl;
            switch(plateType) {
                case "-2":   // weather                     
                    vesCtrl = $get("tbl_win_weather_" + plateId);
                    break;
                default:   // other
                    vesCtrl = $get("tbl_win_attr_" + plateId);                    
                    break;
            }
            
            if(null == ctrlSign || ctrlSign == "undefined" || ctrlSign.value == "0") {
                // 未展开状态
                vesCtrl.style.display = "block";
                ctrlSign.value = "1";
            }
            else if(ctrlSign.value == "1") {                
                vesCtrl.style.display = "none";
                ctrlSign.value = "0";
            }
        }
        
        function doRefreshWeatherWin(plateId) {
            var ctrlSign = $get("_hid_win_attrset_" + plateId);
            var vesCtrl = $get("tbl_win_weather_" + plateId);
            
            vesCtrl.style.display = "none";
            ctrlSign.value = "0";
            
        }
        
        function doCloseWin(plateId) {
            var curWinDiv = $get("div_plate_" + plateId);
            var tblWinCtrl = $get("tbl_win_" + plateId);
            var ctrlSign = $get("_hidWinCtrl_" + plateId);
            if(ctrlSign.value == "1") { //当前为显示状态
                tblWinCtrl.style.display = "none";
                ctrlSign.value = "0";
                
                var ctrlDiv = $get("sort1");
                var firstWin = ctrlDiv.children(0);
                ctrlDiv.insertBefore(curWinDiv,firstWin);
                
            }
            else {
                tblWinCtrl.style.display = "block";
                ctrlSign.value = "1";
            }
        }
        
        function doProvinceChange() {
            var ctrlProvince = new DropDownList("selProvince");
            var selProvince = ctrlProvince.selectedValue;
            ctrlProvince = null;
            PageMethods.GetCitysbyProvince(selProvince,ClientCallBack);
        }
        
        function doQueryWeather(plateId,ctrlType) {
            if(null == ctrlType  || ctrlType == "undefined" || ctrlType == "") {
                ctrlType = "QUERY";
            }
            var ctrlCity = new DropDownList("selCity");
            var selCity = ctrlCity.selectedText;
            ctrlCity = null;
            PageMethods.GetWeatherByCity(selCity,plateId,ctrlType,ClientCallBack);
            if(ctrlType == "QUERY")
                doShowWinSet(plateId,"-2");
        }
        
        function ClientCallBack(result) {
            eval("var resultObj=" + result);
            var operType = resultObj.operType;
            switch(operType) {
                case "GETCITYS":  // get citys by province
                    var cityArray = resultObj.citys;
                    var ctrlCity = new DropDownList("selCity");
                    ctrlCity.clear();
                    // add item
                    var itemCount = cityArray.length;
                    var cityInfo;
                    for(var i = 0; i < itemCount; i ++) {
                        cityInfo = cityArray[i];
                        ctrlCity.addItem(cityInfo.dictText,cityInfo.dictValue);
                    }
                    
                    cityArray = null;
                    ctrlCity = null;
                    break;
               case "GETCITYWEATHER":
                    var plateId = resultObj.plateId;
                    var weatherObj = resultObj.weather;
                    var ctrlType = resultObj.ctrlType;
                    setWeatherInfo(weatherObj);
                    if(ctrlType == "QUERY")
                        doShowWinSet(plateId,"-2");
                    else
                        doRefreshWeatherWin(plateId);
                    weatherObj = null;
                    break;
               case "AUTOSAVELAYOUT":
                    if(!parseInt(resultObj.resultSign) <= 0) {
                        alert(resultObj.message);
                    }
                    break;
               case "SAVEWINATTR":                    
                    if(parseInt(resultObj.resultSign) > 0) {
                        var plateId = resultObj.plateId;
                        var plateType = resultObj.plateType;
                        doCloseWinAttr(plateId);
                        doRefreshWin(plateId,plateType);
                    }
                    else
                        alert(resultObj.message);
                    break;
               case "REFRESHWIN":
                    var winData = resultObj.winData;
                    loadWinData(resultObj.plateId,resultObj.plateType,winData);
                    break;
                case "RECEIVE": //接收待办文件
                    if (parseInt(resultObj.resultCode) < 0) {
                        alert(resultObj.resultMsg);
                    }
                    else {
                        OpenWindow(resultObj.dealURL, "", "", "");
                    }

                    break;
            }
            
            resultObj = null;
        }
        
        function setWeatherInfo(weatherObj) {
            if(null == weatherObj || weatherObj == "undefined") return;
            
            $get("img_weater_today").src = weatherObj.todayTempImg;
            $get("span_weather_today_subject").innerText = weatherObj.cityName + "(" + weatherObj.todaySimpleDate + " " +
                         weatherObj.todayDateDesc + ") " + weatherObj.todayTemperature;
            $get("td_weather_today_desc").innerHTML = weatherObj.todayTempDesc;
            
            $get("img_weather_tom").src = weatherObj.tomTempImg;
            $get("td_weather_tom_subject").innerHTML = weatherObj.tomTempDesc + "<br>" + weatherObj.tomTemperature;
            
            $get("img_weather_aftertom").src = weatherObj.afterTomTempImg;
            $get("td_weather_aftertom_subject").innerHTML = weatherObj.afterTomTempDesc + "<br>" + weatherObj.afterTomTemperature;            
            
        }
        
        function doSetWinAttr(plateId,plateType) {
            var ctrlCount = $get("txt_winattr_count_" + plateId);
            var showCount = "6";
            if(jQuery.trim(ctrlCount.value) != "") {
                if(!ctrlCount.value.IsInteger()) {
                    alert("显示记录数只能录入整数!");
                    ctrlCount.focus();
                    return;
                }
                else
                    showCount = ctrlCount.value;
            }
            
            PageMethods.SaveWinAttr(showCount,plateId,plateType,ClientCallBack);
            
            
        }
        
        function doCloseWinAttr(plateId) {
            var ctrlSign = $get("_hid_win_attrset_" + plateId);
            var vesCtrl = $get("tbl_win_attr_" + plateId);   
            
            vesCtrl.style.display = "none";
            ctrlSign.value = "0";
        }
        
        function doRefreshWin(plateId,plateType) {
            if(plateType != "-2")
                PageMethods.RefreshWin(plateId,plateType,ClientCallBack);
            else
                doQueryWeather(plateId,"REFRESH");
        }
        
        function loadWinData(plateId,plateType,winData) {
            var ctrlTable = $get("tbl_win_content_" + plateId);
            if(plateType == "0" || plateType == "-3" || plateType == "-1") {
                if(plateType == "-1" && typeof(_tt1) != "undefined") {
                    clearTimeout(_tt1);
                }
                clearHisData(ctrlTable,plateType,plateId);
                //ctrlTable.innerHTML += " winData;
                var htrow = ctrlTable.insertRow(1);
                var htcell = htrow.insertCell();
                
                htcell.innerHTML = "<table cellpadding='0' cellspacing='0' width='100%'>" + winData + "</table>";

                if(plateType == "-1") {
                    if(null != $get("tr_script") && typeof($get("tr_script")) != "undefined") {
                        eval($get("tr_script").cells(0).children(0).innerHTML);
                    }                
                }
            }
            else if(plateType == "-2") {
                var rowLen = ctrlTable.lenght;
                ctrlTable.deleteRow(rowLen - 1);
                var htrow = ctrlTable.insertRow();
                var htcell = htrow.insertCell();
                htcell.innerHTML = "<table cellpadding='0' cellspacing='0' width='100%'>" + winData + "</table>";
                
            }
            else {}
        }
        
        function clearHisData(ctrlTable,plateType,plateId) {
            var rowLen = ctrlTable.rows.length;
            var htrow;
            var rowIndex = 0;
            var startIndex = (plateType == "-1") ? (rowLen - 1) : (rowLen - 2);
            var endIndex = 1;
            if(plateId == "10" || plateId == "1") {
                 startIndex = rowLen -1;
                 //endIndex = 1;
            }
            for(var i = startIndex; i >= endIndex; i --) {
                ctrlTable.deleteRow(i);
            }
        }
        
        function doCutWindowMode(plateId,ctrlType) {                        
            if(ctrlType == "1") {     
                $get("tr_plate_stat_" + plateId).style.display = "block";   
                $get("tr_plate_list_" + plateId).style.display = "none";   
                $get("td_bg_status1_" + plateId).style["background"] = "#FFFFFF";
                $get("td_bg_status2_" + plateId).style["background"] = "#E6E6E6";
            }
            else {
                $get("tr_plate_list_" + plateId).style.display = "block"; 
                $get("tr_plate_stat_" + plateId).style.display = "none"; 
                $get("td_bg_status1_" + plateId).style["background"] = "#E6E6E6";
                $get("td_bg_status2_" + plateId).style["background"] = "#FFFFFF";             
            }
        }

        //在首页版块中接受待办文件
        function ReceiveFile(fileId, trackRecId, dealURL) {
            PageMethods.AjaxHandler(fileId, trackRecId, dealURL, ClientCallBack);
        }
        
    //-->
    </script>
    
</head>
<body style="margin:0;width:99%;overflow:scroll;overflow-x:hidden;" onunload="release()">    
    <Form id="form1" runat="server">    
    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server"></asp:ScriptManager>    
    <input type="hidden" id="_hidCellCount" runat="server" />
    <input type="hidden" id="_hidWeatherPlateId" runat="server" />
    <input type="hidden" id="_hidImgPlateId" runat="server" />
    <table width="100%" height='99%' align="left" border="0" cellpadding="0" cellspacing="0">         
        <tr>
            <td id="tdOneFrm" valign="top" height='100%' runat="server" enableviewstate="false">
                <div id="sort1" class="groupWrapper" runat="server" style="width:100%;height:100%" enableviewstate="false"></div>
            </td>
            <td id="tdTwoFrm" valign="top" height='100%'  runat="server" enableviewstate="false" >
                <div id="sort2" class="groupWrapper" runat="server" style="width:100%;height:100%" enableviewstate="false"></div>
            </td>
            <td id="tdThreeFrm" valign="top" height='100%'  runat="server" enableviewstate="false">
                <div id="sort3" class="groupWrapper" runat="server" style="width:100%;height:100%" enableviewstate="false"></div>
            </td>            
        </tr>       
    </table>    
      
    </Form>
    <script type="text/javascript">
    <!--
        $(document).ready(
	        function () {		        
		        $('div.groupWrapper').Sortable(
			        {
				        accept: 'groupItem',
				        helperclass: 'sortHelper',
				        activeclass : 'sortableactive',
				        hoverclass : 'sortablehover',
				        handle: 'div.itemHeader',
				        tolerance: 'pointer',
				        onChange : function(ser)
				        {
				        },
				        onStart : function()
				        {
					        $.iAutoscroller.start(this, document.getElementsByTagName('body'));
				        },
				        onStop : function()
				        {
					        $.iAutoscroller.stop();
				        }
			        }
		        );
		        loadWeatherData();
		        
		        loadImgData();		        
	        }
        );

	    function release() {
	        var frameSetSign = parent.$get("_hidFrameSet").value;
	        if (frameSetSign == "1") {
	            parent.$get("_hidFrameSet").value = "0";
	            return;
	        }    
           var oneCellIds = getCellLayOut("sort1");
           var twoCellIds = getCellLayOut("sort2");
           var threeCellIds = getCellLayOut("sort3");
           
           PageMethods.SaveUserLayOut(oneCellIds,twoCellIds,threeCellIds,ClientCallBack);
        }
        
        function getCellLayOut(cellId) {
            serial = $.SortSerialize(cellId);
	        var strSer = serial.hash;
	        var serArray = strSer.split("&");
	        var itemCount = serArray.length;
	        var containId = "";
	        var ctrlContain;
	        var retIds = "";
	        
	        if (strSer == "") return retIds;
	        
	        for(var i = 0; i < itemCount; i ++) {
	            containId = serArray[i].split("=")[1];
	            ctrlContain = $get(containId);
	            if(ctrlContain.children(0).style.display != "none") {
	                 retIds += (retIds == "") ? serArray[i].split("=")[1] :
	                                 "," + serArray[i].split("=")[1];
	            }
	        }
	        
	        return retIds;
        }
        
        function loadWeatherData() {
            var weatherInfo = $get("_hidWeatherPlateId").value;
            if (weatherInfo == "") return;
            
            var weatherArr = weatherInfo.split(",");
            var plateId = weatherArr[0];
            var plateType = weatherArr[1];
            PageMethods.RefreshWin(plateId,plateType,ClientCallBack);
        }
        
        function loadImgData() {
            var imgInfo = $get("_hidImgPlateId").value;
            if (imgInfo == "") return;          
            var imgArr = imgInfo.split(",");
            var plateId = imgArr[0];
            var plateType = imgArr[1];
            PageMethods.RefreshWin(plateId,plateType,ClientCallBack);
        }
               
    //-->
    </script>
    <script language='javascript' type='text/javascript'>    
	var _t1 = 10;var _t2 = 5;var _tnum =2;var _tn = 1;var _tl =null;var _tt1;
	var playSlide = function() { _tt1 = setTimeout('change_img()',_t1*1000); };	function change_img(){setFocus(_tn); _tt1 = setTimeout('change_img()',_t2*1000); }	function setFocus(i){if(i>_tnum){_tn=1;i=1;}_tl?document.getElementById('focusPic'+_tl).style.display='none':'';document.getElementById('focusPic'+i).style.display='block'; _tl=i;_tn++;}</script>
</body>
</html>
